package com.kehutong.contact.admin;

import com.kehutong.common.util.Token;
import com.kehutong.contact.entity.Customer;
import com.kehutong.contact.service.CustomerRecordService;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;

/**
 * @author liujinwang
 * description: 客户归属记录
 */
@MvcAction
@ReqMapping("/admin/crm/customer/record")
public class CustomerRecordController {

    @Inject
    private CustomerRecordService customerRecordService;

    @ReqMapping("/page")
    public Object page(JSONObject jsonObject){
        return customerRecordService.page(jsonObject);
    }

    @ReqMapping("/save/update")
    public Object saveOrUpdate(Customer customer, Token token) throws Exception {
        return customerRecordService.saveOrUpdate(customer, token);
    }

    @ReqMapping("/delete")
    public Object delete(Customer customer) throws Exception {
        return customerRecordService.delete(customer);
    }
}
